//HeaderDecorator.java
package decorator.printinvoice;

/**
 *@author:youtubezou
 *@version:2012-7-25
 */
public class HeaderDecorator extends OrderDecorator {

	public HeaderDecorator(Order order) {
		super(order);
	}
	
	@Override
	public void print(){
		printHeader();
		order.print();
	}
	
	private void printHeader(){
		System.out.println("\t\t\t***\tINVOICE\t\t***");
		System.out.println("New Incorporated");
		System.out.println("Date of Sale:" + order.getSalesDate());
		System.out.println("Customer: " + order.getCustomerName());
		System.out.println("==========================================================");
		System.out.printf("%10s\t%10s\t%10s\t%10s\n", "Item", "Units", "Unit Price", "Subtotal");
	}
}
